package com.wh.org.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wh.org.dao.IShopAuditLogDao;
import com.wh.org.dto.ShopAuditLogDto;
import com.wh.org.pojo.ShopAuditLog;
import com.wh.org.service.IShopAuditLogService;
import javafx.scene.control.cell.PropertyValueFactory;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class IShopAuditLogServiceimpl implements IShopAuditLogService {
    private IShopAuditLogDao shopAuditLogDao;

    @Override
    public List<ShopAuditLog> findAll() {
        return shopAuditLogDao.selectList(null);
    }

    @Override
    public IPage<ShopAuditLog> findByPage(ShopAuditLogDto shopAuditLogDto) {
        //1.创建查询条件
//        QueryWrapper<Shop> qw = new QueryWrapper<>();
//        qw.like("name",shopDto.getKeyword());
//        qw.or();
//        qw.like("id",shopDto.getKeyword());
        //2.创建分页参数
        IPage<ShopAuditLog> page = new Page<>(shopAuditLogDto.getCurrentPage(),shopAuditLogDto.getPageSize());
        //3.查询数据
        page.setRecords(shopAuditLogDao.findByPage(page));
//        page.setTotal(shopDao.selectCount(qw));
//        List<Shop> list = (List<Shop>) dao.findByPage(page, qw);
//        IPage<Shop> page1 = page.setRecords(list);
        //4.返回结果
        return page;

    }

    @Override
    public ShopAuditLog findOne(Long id) {
        return shopAuditLogDao.selectOne(null);
    }
}
